<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../lib/vue-2.6.7.js"></script>
</head>
<body>
    <div id="app">
       <button v-on:click="fun1">点我有惊喜！</button>  
    </div>
 <script>
     console.log(this)
     const vm = new Vue({
         el:"#app",
         data:{
             "message":"hello"
         },
         methods: {
            fun1:()=>{
                alert("hello vue")
            }
         },
         created() {
             // `this` 指向 vm 实例
             console.log('message is: ' + this.message)
             console.log(this.message)
         },
         beforeMount() {
             //console.log(el)
            console.log(this.message)
         },
         mounted() {
             console.log(this.$el)
            console.log(this.message)
         },
     })
     console.log(this)
 </script>
 
</body>
</html>